<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:r="http://richfaces.org/rich" xmlns:a="http://richfaces.org/a4j"
	xmlns:ad="http://agiledev.com.br/fieldset"
	template="/layout/template.xhtml">
	
	<ui:define name="body">
				
		<h:form id="fTeam">
			
			<s:decorate template="/layout/comands.xhtml">
				<a:commandButton value="#{messages.gravar}" actionListener="#{teamMB.persist}" rendered="#{!teamMB.managed}" reRender="fTeam"/>
				<a:commandButton value="#{messages.gravar}" actionListener="#{teamMB.update}" rendered="#{teamMB.managed}" reRender="fTeam"/>
				<h:outputText value=" " />
				<a:commandButton value="#{messages.excluir}" action="#{teamMB.remove}" rendered="#{teamMB.managed}"/>
				<h:outputText value=" " />
				<a:commandButton value="#{messages.pesquisar}" action="pesquisa" immediate="true"/>
			</s:decorate>
			
			<!-- team -->
			<ad:fieldset legenda="#{messages.team}">

				<s:decorate	template="/layout/edit.xhtml">
					<ui:define name="label">
						<h:outputText value="#{messages.nome}" />
					</ui:define>
					<h:inputText value="#{team.nome}" size="50" maxlength="50" required="true">
						<f:validateLength maximum="50" />
					</h:inputText>
				</s:decorate> 

				<s:decorate	template="/layout/edit.xhtml">
					<ui:define name="label">
						<h:outputText value="#{messages.descricao}" />
					</ui:define>
					<h:inputTextarea value="#{team.descricao}" rows="3" cols="50">
						<f:validateLength maximum="255" />
					</h:inputTextarea>
				</s:decorate> 

			</ad:fieldset>

			<!-- team -->
			<ad:fieldset legenda="#{messages.componentes}">
				
				<s:decorate template="/layout/comands.xhtml">
					<a:commandButton value="#{messages.novo}" ajaxSingle="true" actionListener="#{teamMB.newComponent}" rendered="#{teamMB.managed}" reRender="dtComps"/>
				</s:decorate>
			
				<ui:include src="/pages/team/componentes.xhtml"/>
			</ad:fieldset>

		</h:form>
	
	</ui:define>
</ui:composition>